/*
 ============================================================================
 Name		: Utils.cpp
 Author	  : william
 Version	 : 1.0
 Copyright   : free software
 Description : CUtils implementation
 ============================================================================
 */

#include <aknglobalnote.h>
#include "Utils.h"

CUtils::CUtils()
    {
    // No implementation required
    }

CUtils::~CUtils()
    {
    }

CUtils* CUtils::NewLC()
    {
    CUtils* self = new (ELeave) CUtils();
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
    }

CUtils* CUtils::NewL()
    {
    CUtils* self = CUtils::NewLC();
    CleanupStack::Pop(); // self;
    return self;
    }

void CUtils::ConstructL()
    {

    }

void CUtils::ShowMsg(const TDesC& aMsg)
    {
    CAknGlobalNote* globalNote = CAknGlobalNote::NewLC();
    globalNote->ShowNoteL(EAknGlobalInformationNote, aMsg);
    CleanupStack::PopAndDestroy(globalNote);    
    }

void CUtils::ShowMsg(const TDesC& aMsg, TInt aErr)
	{
    CAknGlobalNote* globalNote = CAknGlobalNote::NewLC();
    TBuf<50> msg;
    msg.AppendFormat(aMsg,": %D",aErr);
    globalNote->ShowNoteL(EAknGlobalInformationNote, msg);
    CleanupStack::PopAndDestroy(globalNote); 	
	}
